#include "person.h"
#include "clothing.h"

int main()
{
    
    cout << "第一种装扮：" << endl;
    Character *xiaoLi = new Person("小李");
    Clothing *tShirt = new TShirt();
    tShirt->decorate(tShirt);
    CasualPants *casualPants = new CasualPants();
    casualPants->decorate(casualPants);
    GymShoes *gymShoes = new GymShoes();
    gymShoes->decorate(gymShoes);
    
    xiaoLi->show();

    // cout << "第二种装扮：" << endl;
    // Suits *suits = new Suits();
    // suits->decorate(xiaoLi);
    // Tie *tie = new Tie();
    // tie->decorate(suits);
    // LeatherShoes *leatherShoes = new LeatherShoes();
    // leatherShoes->decorate(tie);

    if (xiaoLi != nullptr)
    {
        delete xiaoLi;
        xiaoLi = nullptr;
    }

    if (gymShoes != nullptr)
    {
        delete gymShoes;
        gymShoes = nullptr;
    }

    if (casualPants != nullptr)
    {
        delete casualPants;
        casualPants = nullptr;
    }

    if (tShirt != nullptr)
    {
        delete tShirt;
        tShirt = nullptr;
    }

    // if (suits != nullptr)
    // {
    //     delete suits;
    //     suits = nullptr;
    // }

    // if (tie != nullptr)
    // {
    //     delete tie;
    //     tie = nullptr;
    // }

    // if (leatherShoes != nullptr)
    // {
    //     delete leatherShoes;
    //     leatherShoes = nullptr;
    // }

    return 0;
}